﻿@{
    Layout = null;
}

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />

    <link rel="stylesheet" type="text/css" href="~/H-ui/static/h-ui/css/H-ui.min.css" />
    <link rel="stylesheet" type="text/css" href="~/H-ui/static/h-ui.admin/css/H-ui.admin.css" />
    <link rel="stylesheet" type="text/css" href="~/H-ui/lib/Hui-iconfont/1.0.8/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="~/H-ui/static/h-ui.admin/skin/green/skin.css" id="skin" />
    <link rel="stylesheet" type="text/css" href="~/H-ui/static/h-ui.admin/css/style.css" />
    <link href="~/css/img.css" rel="stylesheet" />
    <title>报修</title>
</head>
<body class="bb1">
    <div align=center class="d1">
        <marquee style="FONT-SIZE: 35pt; WIDTH: 400px; FILTER: shadow(color=#AF0530); LINE-HEIGHT:15pt; FONT-FAMILY: 隶书; HEIGHT: 80px" scrollamount=6>
            <h2 style="margin-top:0px;text-align:center"><font color=#f90b46>报修 </font></h2>
        </marquee>
    </div>
    <aside class="Hui-aside" style="margin-top:-5px">
        <div class="menu_dropdown bk_2" id="div1">
        </div>
    </aside>
    <div class="page-container">
        <div class="text-c">
            <form action="/Repairs/submints" method="post" enctype="multipart/form-data">
                <table class="table table-bordered table-border table-hover" style="width:900px;margin-left:200px; margin-top:50px;">
                    <tr>
                        <td>你选择的节点：</td>
                        <td id="cheName"></td>
                    </tr>
                    <tr>
                        <td>报修名称：</td>
                        <td>
                            <input type="text" name="txtRepName" required />
                        </td>
                    </tr>
                    <tr>
                        <td>问题描述：</td>
                        <td><textarea id="TextArea1" rows="2" cols="20" name="txtDesc" required></textarea></td>
                    </tr>
                    <tr>
                        <td>发现人：</td>
                        <td>
                            <input type="text" name="txtFname" required />
                        </td>

                    </tr>
                    <tr>
                        <td>发现时间：</td>
                        <td>
                            <input type="date" name="txtDate" required />
                        </td>
                    </tr>
                    <tr>
                        <td>问题等级：</td>
                        <td>
                            <select name="txtGrade">
                                <option>一级</option>
                                <option>二级</option>
                                <option>三级</option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td>上传问题配件图片：</td>
                        <td>
                            <input type="file" name="image" id="txtimg" onchange="fileshow()" required />
                        </td>
                    </tr>
                    <tr>
                        <td></td>
                        <td>
                            <img id="imgs" src="" width="200" height="100" />
                        </td>
                    </tr>
                    <tr>
                        <td></td>
                        <td>
                            <input type="submit" value="提交" class="btn btn-success" />
                        </td>
                    </tr>
                </table>
            </form>
            <footer class="footer mt-20">
                <div class="container">
                    <p>
                        关于我们  |  联系我们    |  项目合作  |  广告植入   |  友情链接<br />
                        版权所有 京ICP备11009069<br />
                        Copyright ©2016 Gaotie.cn
                    </p>
                </div>
            </footer>
        </div>
        </div>

        <!--_footer 作为公共模版分离出去-->
        <script type="text/javascript" src="~/H-ui/lib/jquery/1.9.1/jquery.min.js"></script>
        <script type="text/javascript" src="~/H-ui/lib/layer/2.4/layer.js"></script>
        <script type="text/javascript" src="~/H-ui/static/h-ui/js/H-ui.min.js"></script>
        <script type="text/javascript" src="~/H-ui/static/h-ui.admin/js/H-ui.admin.js"></script> <!--/_footer 作为公共模版分离出去-->
        <!--请在下方写此页面业务相关的脚本-->
        <script type="text/javascript" src="lib/jquery.contextmenu/jquery.contextmenu.r2.js"></script>
        <script>
            function fileshow() {
                var img = document.getElementById("txtimg").files[0];
                var file = new FileReader();
                file.readAsDataURL(img);
                file.onload = function () {
                    document.getElementById("imgs").src = file.result;
                }
            }
            show();
            function show() {
            }
            //显示父级节点
            show();
            function show() {
                $.ajax({
                    type: "post",
                    url: "/Repairs/Partents",
                    dataType: "json",
                    success: function (data) {
                        var htmltab = "";
                        for (var m = 0; m < data.length; m++) {
                            var pid = data[m].WagonId
                            htmltab += "<dl id=\"menu-" + m + "\">"
                            htmltab += "<dt><i class=\"Hui-iconfont\">&#xe616;</i><span onclick=\"huoid(" + pid + ")\">" + data[m].WagonName + "</span><i class=\"Hui-iconfont menu_dropdown-arrow\"  onclick=\"ff(" + pid + ")\">&#xe6d5;</i></dt>"
                            htmltab += "<dd id=\"dd" + pid + "\"><span id=\"mm" + pid + "\">" + parentId(pid) + "</span></dd>"
                            htmltab += "</dl>";
                            $("#div1").html(htmltab);
                        }
                    }
                })
            }
            //显示子级节点
            function parentId(id) {
                $.ajax({
                    type: "post",
                    url: "/Repairs/Partent_Id",
                    data: { id: id },
                    dataType: "json",
                    success: function (result) {
                        var htmltab = "";
                        for (var m = 0; m < result.length; m++) {
                            var sid = result[m].RailWayId
                            htmltab += "<dl id=\"menu-" + m + "\">"
                            htmltab += "<dt >&nbsp;&nbsp;&nbsp;&nbsp;<i class=\"Hui-iconfont\"></i><span onclick=\"huoid2(" + sid + ")\">" + result[m].RailWayName + "</span><i class=\"Hui-iconfont menu_dropdown-arrow\"  onclick=\"ee(" + sid + ")\">&#xe6d5;</i></dt>"
                            htmltab += "<dd id=\"aa" + sid + "\"><span id=\"ss" + sid + "\">" + parentId2(sid) + "</span></dd>"
                            htmltab += "</dl>";
                            $("#mm" + id + "").html(htmltab);
                        }
                    }
                })
            }
            //显示san子级节点
            function parentId2(id) {
                $.ajax({
                    type: "post",
                    url: "/Repairs/Partent_Id2",
                    data: { id: id },
                    dataType: "json",
                    success: function (result) {
                        var htmltab1 = "";
                        for (var j = 0; j < result.length; j++) {

                            htmltab1 += "<ul style=\"margin-left:50px;\"><li onclick=\"huoid3(" + result[j].PartsId + ")\">" + result[j].PartsName + "</li></ul>"
                        }
                        $("#ss" + id + "").html(htmltab1);
                    }
                })
            }
            //一级点击下拉事件
            function ff(id) {
                if ($("#dd" + id).attr("class") == "selected") {
                    $("#dd" + id).removeClass("selected")
                    $(this).addClass("selected");
                }
                else {
                    $("#dd" + id).addClass("selected")
                    $(this).removeClass("selected");
                }

            }
            //二级点击下拉事件
            function ee(id) {
                if ($("#aa" + id).attr("class") == "selected") {
                    $("#aa" + id).removeClass("selected")
                    $(this).addClass("selected");
                }
                else {
                    $("#aa" + id).addClass("selected")
                    $(this).removeClass("selected");
                }

            }

            //获取一级的id
            function huoid(id) {
            }
            //获取二级的id
            function huoid2(id) {
                $.ajax({
                    type: "post",
                    url: "/Repairs/BackCXName",
                    data: { id: id },
                    success: function (data) {
                        $("#cheName").text(data);
                    }
                })
            }
        </script>
</body>
</html>

